// -> array.html
// -> 배열

window.onload=function()
{
	var su1=[12,312,312,3,215,3465,7,876,867,978];
	var su2=[8,76,4,645,23,2,54,6,75,6,3,2,34,1];
	var river=['한강','두만강','낙동강','섬진강','영산강'];
	var mnt=['백두산','한라산','설악산','내장산','지리산'];
	
	var r= document.getElementById('result1');
	var str = '';
	str += 'su1.concat(su2) = ' + su1.concat(su2);
	str += '<br>river.concat(mnt) = ' + river.concat(mnt);
	r.innerHTML = str;
	
	joinBtn.onclick = function()
	{
		r = document.getElementById('result2');
		var joinStr = '';//조인할 문자욜
		var obj = frm.join;
		for(i=0; i<obj.length; i++)
		{
			if(obj[i].checked == true)
			{
				joinStr = obj[i].value;
				break;
			}
		}
		str = '<b> su1 = </b>' + su1.join(joinStr);
		str += '<br><b> su1 = </b>' + su2.join(joinStr);
		str += '<br><b> su1 = </b>' + river.join(joinStr);
		str += '<br><b> su1 = </b>' + mnt.join(joinStr);
		r.innerHTML = str;
	};
	
	
	reverseBtn.onclick = function()
	{
		r= document.getElementById('result3');
		
		var chk = frm.chk;
		var str='';
		if(chk.checked==true)
		{
			str+= '<b>su1.reverse() = </b>' + su1.reverse();
			str+= '<br><b>su1.reverse() = </b>' + su2.reverse();
			str+= '<br><b>su1.reverse() = </b>' + river.reverse();
			str+= '<br><b>su1.reverse() = </b>' + mnt.reverse();
			str+= '<br><b>su1.reverse() = </b>' + su1.concat(su2).reverse();
			str+= '<br><b>su1.reverse() = </b>' + river.concat(mnt).reverse();
		}
		else
		{
			str+= '<b>su1.reverse() = </b>' + su1;
			str+= '<br><b>su1.reverse() = </b>' + su2;
			str+= '<br><b>su1.reverse() = </b>' + river;
			str+= '<br><b>su1.reverse() = </b>' + mnt;
		}
		r.innerHTML = str;
		
	};
};